#pragma once

#include <vector>

#include "../ChessCore/IEngine.h"
#include "../ChessCore/IAppSender.h"

#include "Move.h"
#include "Player.h"
#include "Position.h"

namespace Rorn
{
	namespace Chess
	{
		namespace TheCorruptRook
		{
			class EngineState;

			class Engine : public Rorn::Chess::IEngine
			{
			public:
				friend class EngineStateSleeping;
				friend class EngineStateWatching;

				Engine(Rorn::Chess::IAppSender* appSender);
				virtual ~Engine(void);

				virtual void StartNewGame();

				virtual void Update();
			private:
				void ChangeState(EngineState* newState);

				Rorn::Chess::IAppSender* appSender_;

				EngineState* currentState_;

				Position currentPosition_;
				Player::Type currentPlayer_;
			};
		}
	}
}
